//
//  AddNavigationController.m
//  Four_years
//
//  Created by 中软国际088 on 15/11/10.
//  Copyright © 2015年 中软三班四年小组. All rights reserved.
//

#import "AddNavigationController.h"
#import "DiraySingle.h"
#import "IfCancelSingle.h"

@interface AddNavigationController ()

@end

@implementation AddNavigationController

- (void)viewDidLoad {
    [super viewDidLoad];
    
  
    [self.navigationBar setBarTintColor:[UIColor colorWithRed:93/255.0 green:224/255.0 blue:150/255.0 alpha:1]];
    
    
    
    
}

- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    
 
      

}

//初始化导航栏上的按钮
- (void)initnavigationBarItems:(UIViewController *)ctr{
    
    ctr.navigationItem.title = @"新建";
    
    ctr.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:[UIColor whiteColor],NSFontAttributeName:[UIFont systemFontOfSize:20]};
    //初始化取消按钮
    
    UIBarButtonItem *left = [[UIBarButtonItem alloc]initWithTitle:@"取消" style:UIBarButtonItemStylePlain target:self action:@selector(cancel:)];
   
    
    ctr.navigationItem.leftBarButtonItem = left;
    
    
    //初始化确定按钮
    UIBarButtonItem *right = [[UIBarButtonItem alloc]initWithTitle:@"确定" style:UIBarButtonItemStyleDone target:self action:@selector(finish:)];
    
    ctr.navigationItem.rightBarButtonItem = right;
    
}

//取消按钮触发事件
- (void)cancel:(id)sender{
    
    if (sender && [sender isKindOfClass:[UIBarButtonItem class]]) {
    
        if (_judgeNum == 0) {
              [self dismissViewControllerAnimated:YES completion:nil];
        }
      
        else{
            
            
        
        }
      
    }
   
    
}

- (void)finish:(id)sender{
    
    [IfCancelSingle shareManager].ifCancerNumber = 1;
  
    
    [self dismissViewControllerAnimated:YES completion:nil];
    
}


@end
